home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / QuickTimeStreaming.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  37.6 KB  |  1,200 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        QuickTimeStreaming.h
  3.  
  4.      Contains:    QuickTime interfaces
  5.  
  6.      Version:    Technology:    
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1990-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QUICKTIMESTREAMING__
  18. #define __QUICKTIMESTREAMING__
  19.  
  20. #ifndef __QUICKDRAW__
  21.     #include <Quickdraw.h>
  22. #endif
  23.  
  24. #ifndef __COMPONENTS__
  25.     #include <Components.h>
  26. #endif
  27.  
  28. #ifndef __MOVIES__
  29.     #include <Movies.h>
  30. #endif
  31.  
  32. #ifndef __QUICKTIMECOMPONENTS__
  33.     #include <QuickTimeComponents.h>
  34. #endif
  35.  
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59. enum {
  60.     kQTSInfiniteDuration        = 0x7FFFFFFF,
  61.     kQTSUnknownDuration            = 0x00000000,
  62.     kQTSNormalForwardRate        = 0x00010000,
  63.     kQTSStoppedRate                = 0x00000000
  64. };
  65.  
  66.  
  67. struct QTSPresentationRecord {
  68.     long                             data[1];
  69. };
  70. typedef struct QTSPresentationRecord    QTSPresentationRecord;
  71.  
  72. typedef QTSPresentationRecord *            QTSPresentation;
  73.  
  74. struct QTSStreamRecord {
  75.     long                             data[1];
  76. };
  77. typedef struct QTSStreamRecord            QTSStreamRecord;
  78.  
  79. typedef QTSStreamRecord *                QTSStream;
  80.  
  81. struct QTSEditEntry {
  82.     TimeValue64                     presentationDuration;
  83.     TimeValue64                     streamStartTime;
  84.     Fixed                             streamRate;
  85. };
  86. typedef struct QTSEditEntry                QTSEditEntry;
  87.  
  88. struct QTSEditList {
  89.     SInt32                             numEdits;
  90.     QTSEditEntry                     edits[1];
  91. };
  92. typedef struct QTSEditList                QTSEditList;
  93. typedef QTSEditList *                    QTSEditListPtr;
  94. typedef QTSEditListPtr *                QTSEditListHandle;
  95. #define kQTSInvalidPresentation        (QTSPresentation)0L
  96. #define kQTSAllPresentations        (QTSPresentation)0L
  97. #define kQTSInvalidStream            (QTSStream)0L
  98. #define kQTSAllStreams                (QTSStream)0L
  99. /*-----------------------------------------
  100.     Get / Set Info
  101. -----------------------------------------*/
  102. enum {
  103.     kQTSGetURLLink                = FOUR_CHAR_CODE('gull')        /* QTSGetURLLinkRecord* */
  104. };
  105.  
  106. /* get and set */
  107. enum {
  108.     kQTSTargetBufferDurationInfo = FOUR_CHAR_CODE('bufr'),        /* Fixed* in seconds; expected, not actual */
  109.     kQTSDurationInfo            = FOUR_CHAR_CODE('dura'),        /* QTSDurationAtom* */
  110.     kQTSSourceTrackIDInfo        = FOUR_CHAR_CODE('otid'),        /* UInt32* */
  111.     kQTSSourceLayerInfo            = FOUR_CHAR_CODE('olyr'),        /* UInt16* */
  112.     kQTSSourceLanguageInfo        = FOUR_CHAR_CODE('olng'),        /* UInt16* */
  113.     kQTSSourceTrackFlagsInfo    = FOUR_CHAR_CODE('otfl'),        /* SInt32* */
  114.     kQTSSourceDimensionsInfo    = FOUR_CHAR_CODE('odim'),        /* QTSDimensionParams* */
  115.     kQTSSourceVolumesInfo        = FOUR_CHAR_CODE('ovol'),        /* QTSVolumesParams* */
  116.     kQTSSourceMatrixInfo        = FOUR_CHAR_CODE('omat'),        /* MatrixRecord* */
  117.     kQTSSourceClipRectInfo        = FOUR_CHAR_CODE('oclp'),        /* Rect* */
  118.     kQTSSourceGraphicsModeInfo    = FOUR_CHAR_CODE('ogrm'),        /* QTSGraphicsModeParams* */
  119.     kQTSSourceScaleInfo            = FOUR_CHAR_CODE('oscl'),        /* Point* */
  120.     kQTSSourceBoundingRectInfo    = FOUR_CHAR_CODE('orct'),        /* Rect* */
  121.     kQTSSourceUserDataInfo        = FOUR_CHAR_CODE('oudt'),        /* UserData */
  122.     kQTSSourceInputMapInfo        = FOUR_CHAR_CODE('oimp')        /* QTAtomContainer */
  123. };
  124.  
  125. /* get only */
  126. enum {
  127.     kQTSStatisticsInfo            = FOUR_CHAR_CODE('stat'),        /* QTSStatisticsParams* */
  128.     kQTSMinStatusDimensionsInfo    = FOUR_CHAR_CODE('mstd'),        /* QTSDimensionParams* */
  129.     kQTSNormalStatusDimensionsInfo = FOUR_CHAR_CODE('nstd'),    /* QTSDimensionParams* */
  130.     kQTSNetworkIDStringInfo        = FOUR_CHAR_CODE('nids'),        /* char * (c string) */
  131.     kQTSTotalDataRateInfo        = FOUR_CHAR_CODE('drtt'),        /* UInt32*, add to what's there */
  132.     kQTSTotalDataRateInInfo        = FOUR_CHAR_CODE('drti'),        /* UInt32*, add to what's there */
  133.     kQTSTotalDataRateOutInfo    = FOUR_CHAR_CODE('drto'),        /* UInt32*, add to what's there */
  134.     kQTSDataRateHistoryInfo        = FOUR_CHAR_CODE('drth'),        /* QTSDataRateHistoryParams* */
  135.     kQTSLostPercentInfo            = FOUR_CHAR_CODE('lpct'),        /* QTSLostPercentParams*, add to what's there */
  136.     kQTSMediaTypeInfo            = FOUR_CHAR_CODE('mtyp'),        /* OSType* */
  137.     kQTSNameInfo                = FOUR_CHAR_CODE('name'),        /* QTSNameParams* */
  138.     kQTSSampleDescriptionInfo    = FOUR_CHAR_CODE('sdsc'),        /* SampleDescriptionHandle */
  139.     kQTSCanHandleSendDataType    = FOUR_CHAR_CODE('chsd'),        /* QTSCanHandleSendDataTypeParams* */
  140.     kQTSAnnotationsInfo            = FOUR_CHAR_CODE('meta')        /* QTAtomContainer */
  141. };
  142.  
  143. enum {
  144.     kQTSTargetBufferDurationTimeScale = 1000
  145. };
  146.  
  147.  
  148.  
  149. struct QTSDataRateHistoryParams {
  150.     UInt32                             changeSeed;
  151.     UInt32                             millisecondsBetweenElements;
  152.     UInt32                             numberOfIntervals;
  153.     UInt32 *                        elements;                    /* in bits/sec; callee allocates; caller must dispose */
  154.  
  155. };
  156. typedef struct QTSDataRateHistoryParams    QTSDataRateHistoryParams;
  157.  
  158. struct QTSCanHandleSendDataTypeParams {
  159.     SInt32                             modifierTypeOrInputID;
  160.     Boolean                         isModifierType;
  161.     Boolean                         returnedCanHandleSendDataType; /* callee sets to true if it can handle it*/
  162. };
  163. typedef struct QTSCanHandleSendDataTypeParams QTSCanHandleSendDataTypeParams;
  164.  
  165. struct QTSNameParams {
  166.     SInt32                             maxNameLength;
  167.     SInt32                             requestedLanguage;
  168.     SInt32                             returnedActualLanguage;
  169.     unsigned char *                    returnedName;                /* pascal string; caller supplies*/
  170. };
  171. typedef struct QTSNameParams            QTSNameParams;
  172.  
  173. struct QTSLostPercentParams {
  174.     UInt32                             receivedPkts;
  175.     UInt32                             lostPkts;
  176.     Fixed                             percent;
  177. };
  178. typedef struct QTSLostPercentParams        QTSLostPercentParams;
  179.  
  180. struct QTSDimensionParams {
  181.     Fixed                             width;
  182.     Fixed                             height;
  183. };
  184. typedef struct QTSDimensionParams        QTSDimensionParams;
  185.  
  186. struct QTSVolumesParams {
  187.     SInt16                             leftVolume;
  188.     SInt16                             rightVolume;
  189. };
  190. typedef struct QTSVolumesParams            QTSVolumesParams;
  191.  
  192. struct QTSGraphicsModeParams {
  193.     SInt16                             graphicsMode;
  194.     RGBColor                         opColor;
  195. };
  196. typedef struct QTSGraphicsModeParams    QTSGraphicsModeParams;
  197.  
  198. struct QTSGetURLLinkRecord {
  199.     Point                             displayWhere;
  200.     Handle                             returnedURLLink;
  201. };
  202. typedef struct QTSGetURLLinkRecord        QTSGetURLLinkRecord;
  203. /*-----------------------------------------
  204.     Characteristics
  205. -----------------------------------------*/
  206. /* characteristics in Movies.h work here too */
  207. enum {
  208.     kQTSSupportsPerStreamControlCharacteristic = FOUR_CHAR_CODE('psct')
  209. };
  210.  
  211.  
  212. struct QTSVideoParams {
  213.     Fixed                             width;
  214.     Fixed                             height;
  215.     MatrixRecord                     matrix;
  216.     CGrafPtr                         gWorld;
  217.     GDHandle                         gdHandle;
  218.     RgnHandle                         clip;
  219.     short                             graphicsMode;
  220.     RGBColor                         opColor;
  221. };
  222. typedef struct QTSVideoParams            QTSVideoParams;
  223.  
  224. struct QTSAudioParams {
  225.     SInt16                             leftVolume;
  226.     SInt16                             rightVolume;
  227.     SInt16                             bassLevel;
  228.     SInt16                             trebleLevel;
  229.     short                             frequencyBandsCount;
  230.     void *                            frequencyBands;
  231.     Boolean                         levelMeteringEnabled;
  232. };
  233. typedef struct QTSAudioParams            QTSAudioParams;
  234.  
  235. struct QTSMediaParams {
  236.     QTSVideoParams                     v;
  237.     QTSAudioParams                     a;
  238. };
  239. typedef struct QTSMediaParams            QTSMediaParams;
  240. enum {
  241.     kQTSMustDraw                = 1 << 3,
  242.     kQTSAtEnd                    = 1 << 4,
  243.     kQTSPreflightDraw            = 1 << 5,
  244.     kQTSSyncDrawing                = 1 << 6
  245. };
  246.  
  247. /* media task result flags */
  248. enum {
  249.     kQTSDidDraw                    = 1 << 0,
  250.     kQTSNeedsToDraw                = 1 << 2,
  251.     kQTSDrawAgain                = 1 << 3,
  252.     kQTSPartialDraw                = 1 << 4
  253. };
  254.  
  255. /*============================================================================
  256.         Notifications
  257. ============================================================================*/
  258. typedef CALLBACK_API( ComponentResult , QTSNotificationProcPtr )(ComponentResult inErr, OSType inNotificationType, void *inNotificationParams, void *inRefCon);
  259. typedef STACK_UPP_TYPE(QTSNotificationProcPtr)                     QTSNotificationUPP;
  260. /* ------ notification types ------ */
  261. enum {
  262.     kQTSNullNotification        = FOUR_CHAR_CODE('null'),        /* NULL */
  263.     kQTSErrorNotification        = FOUR_CHAR_CODE('err '),        /* QTSErrorParams*, optional */
  264.     kQTSNewPresDetectedNotification = FOUR_CHAR_CODE('newp'),    /* QTSNewPresDetectedParams* */
  265.     kQTSPresBeginChangingNotification = FOUR_CHAR_CODE('prcb'),    /* NULL */
  266.     kQTSPresDoneChangingNotification = FOUR_CHAR_CODE('prcd'),    /* NULL */
  267.     kQTSPresentationChangedNotification = FOUR_CHAR_CODE('prch'), /* NULL */
  268.     kQTSNewStreamNotification    = FOUR_CHAR_CODE('stnw'),        /* QTSNewStreamParams* */
  269.     kQTSStreamBeginChangingNotification = FOUR_CHAR_CODE('stcb'), /* QTSStream */
  270.     kQTSStreamDoneChangingNotification = FOUR_CHAR_CODE('stcd'), /* QTSStream */
  271.     kQTSStreamChangedNotification = FOUR_CHAR_CODE('stch'),        /* QTSStreamChangedParams* */
  272.     kQTSStreamGoneNotification    = FOUR_CHAR_CODE('stgn'),        /* QTSStreamGoneParams* */
  273.     kQTSPreviewAckNotification    = FOUR_CHAR_CODE('pvak'),        /* QTSStream */
  274.     kQTSPrerollAckNotification    = FOUR_CHAR_CODE('pack'),        /* QTSStream */
  275.     kQTSStartAckNotification    = FOUR_CHAR_CODE('sack'),        /* QTSStream */
  276.     kQTSStopAckNotification        = FOUR_CHAR_CODE('xack'),        /* QTSStream */
  277.     kQTSStatusNotification        = FOUR_CHAR_CODE('stat'),        /* QTSStatusParams* */
  278.     kQTSURLNotification            = FOUR_CHAR_CODE('url '),        /* QTSURLParams* */
  279.     kQTSDurationNotification    = FOUR_CHAR_CODE('dura'),        /* QTSDurationAtom* */
  280.     kQTSNewPresentationNotification = FOUR_CHAR_CODE('nprs'),    /* QTSPresentation */
  281.     kQTSPresentationGoneNotification = FOUR_CHAR_CODE('xprs'),    /* QTSPresentation */
  282.     kQTSServerNameNotification    = FOUR_CHAR_CODE('snam'),        /* const char * */
  283.     kQTSPresentationDoneNotification = FOUR_CHAR_CODE('pdon'),    /* NULL */
  284.     kQTSBandwidthAlertNotification = FOUR_CHAR_CODE('bwal'),    /* QTSBandwidthAlertParams* */
  285.     kQTSAnnotationsChangedNotification = FOUR_CHAR_CODE('meta')    /* NULL */
  286. };
  287.  
  288.  
  289. /* flags for QTSErrorParams */
  290. enum {
  291.     kQTSFatalErrorFlag            = 0x00000001
  292. };
  293.  
  294.  
  295. struct QTSErrorParams {
  296.     const char *                    errorString;
  297.     SInt32                             flags;
  298. };
  299. typedef struct QTSErrorParams            QTSErrorParams;
  300.  
  301. struct QTSNewPresDetectedParams {
  302.     void *                            data;
  303. };
  304. typedef struct QTSNewPresDetectedParams    QTSNewPresDetectedParams;
  305.  
  306. struct QTSNewStreamParams {
  307.     QTSStream                         stream;
  308. };
  309. typedef struct QTSNewStreamParams        QTSNewStreamParams;
  310.  
  311. struct QTSStreamChangedParams {
  312.     QTSStream                         stream;
  313.     ComponentInstance                 mediaComponent;                /* could be NULL */
  314. };
  315. typedef struct QTSStreamChangedParams    QTSStreamChangedParams;
  316.  
  317. struct QTSStreamGoneParams {
  318.     QTSStream                         stream;
  319. };
  320. typedef struct QTSStreamGoneParams        QTSStreamGoneParams;
  321.  
  322. struct QTSStatusParams {
  323.     UInt32                             status;
  324.     const char *                    statusString;
  325.     UInt32                             detailedStatus;
  326.     const char *                    detailedStatusString;
  327. };
  328. typedef struct QTSStatusParams            QTSStatusParams;
  329.  
  330. struct QTSInfoParams {
  331.     OSType                             infoType;
  332.     void *                            infoParams;
  333. };
  334. typedef struct QTSInfoParams            QTSInfoParams;
  335.  
  336. struct QTSURLParams {
  337.     UInt32                             urlLength;
  338.     const char *                    url;
  339. };
  340. typedef struct QTSURLParams                QTSURLParams;
  341. enum {
  342.     kQTSBandwidthAlertNeedToStop = 1 << 0,
  343.     kQTSBandwidthAlertRestartAt    = 1 << 1
  344. };
  345.  
  346.  
  347. struct QTSBandwidthAlertParams {
  348.     long                             flags;
  349.     TimeValue                         restartAt;
  350.     void *                            reserved;
  351. };
  352. typedef struct QTSBandwidthAlertParams    QTSBandwidthAlertParams;
  353. /*============================================================================
  354.         Presentation
  355. ============================================================================*/
  356. /*-----------------------------------------
  357.      Flags
  358. -----------------------------------------*/
  359. /* flags for NewPresentationFromData */
  360. enum {
  361.     kQTSAutoModeFlag            = 0x00000001,
  362.     kQTSDontShowStatusFlag        = 0x00000008,
  363.     kQTSSendMediaFlag            = 0x00010000,
  364.     kQTSReceiveMediaFlag        = 0x00020000
  365. };
  366.  
  367.  
  368. struct QTSNewPresentationParams {
  369.     OSType                             dataType;
  370.     const void *                    data;
  371.     UInt32                             dataLength;
  372.     QTSEditListHandle                 editList;
  373.     SInt32                             flags;
  374.     TimeScale                         timeScale;                    /* set to 0 for default timescale */
  375.     QTSMediaParams *                mediaParams;
  376.     QTSNotificationUPP                 notificationProc;
  377.     void *                            notificationRefCon;
  378. };
  379. typedef struct QTSNewPresentationParams    QTSNewPresentationParams;
  380.  
  381. struct QTSPresIdleParams {
  382.     QTSStream                         stream;
  383.     TimeValue64                     movieTimeToDisplay;
  384.     SInt32                             flagsIn;
  385.     SInt32                             flagsOut;
  386. };
  387. typedef struct QTSPresIdleParams        QTSPresIdleParams;
  388. /*-----------------------------------------
  389.     Toolbox Init/Close
  390. -----------------------------------------*/
  391. /* all "apps" must call this */
  392. EXTERN_API_C( OSErr )
  393. InitializeQTS                    (void);
  394.  
  395. EXTERN_API_C( OSErr )
  396. TerminateQTS                    (void);
  397.  
  398. /*-----------------------------------------
  399.     Presentation Functions
  400. -----------------------------------------*/
  401. EXTERN_API_C( OSErr )
  402. QTSNewPresentation                (const QTSNewPresentationParams * inParams,
  403.                                  QTSPresentation *        outPresentation);
  404.  
  405. EXTERN_API_C( OSErr )
  406. QTSDisposePresentation            (QTSPresentation         inPresentation,
  407.                                  SInt32                 inFlags);
  408.  
  409. EXTERN_API_C( void )
  410. QTSPresIdle                        (QTSPresentation         inPresentation,
  411.                                  QTSPresIdleParams *    ioParams);
  412.  
  413. EXTERN_API_C( OSErr )
  414. QTSPresInvalidateRegion            (QTSPresentation         inPresentation,
  415.                                  RgnHandle                 inRegion);
  416.  
  417. /*-----------------------------------------
  418.     Presentation Configuration
  419. -----------------------------------------*/
  420. EXTERN_API_C( OSErr )
  421. QTSPresSetFlags                    (QTSPresentation         inPresentation,
  422.                                  SInt32                 inFlags,
  423.                                  SInt32                 inFlagsMask);
  424.  
  425. EXTERN_API_C( OSErr )
  426. QTSPresGetFlags                    (QTSPresentation         inPresentation,
  427.                                  SInt32 *                outFlags);
  428.  
  429. EXTERN_API_C( OSErr )
  430. QTSPresGetTimeBase                (QTSPresentation         inPresentation,
  431.                                  TimeBase *                outTimeBase);
  432.  
  433. EXTERN_API_C( OSErr )
  434. QTSPresGetTimeScale                (QTSPresentation         inPresentation,
  435.                                  TimeScale *            outTimeScale);
  436.  
  437. EXTERN_API_C( OSErr )
  438. QTSPresSetInfo                    (QTSPresentation         inPresentation,
  439.                                  QTSStream                 inStream,
  440.                                  OSType                 inSelector,
  441.                                  void *                    ioParam);
  442.  
  443. EXTERN_API_C( OSErr )
  444. QTSPresGetInfo                    (QTSPresentation         inPresentation,
  445.                                  QTSStream                 inStream,
  446.                                  OSType                 inSelector,
  447.                                  void *                    ioParam);
  448.  
  449. EXTERN_API_C( OSErr )
  450. QTSPresHasCharacteristic        (QTSPresentation         inPresentation,
  451.                                  QTSStream                 inStream,
  452.                                  OSType                 inCharacteristic,
  453.                                  Boolean *                outHasIt);
  454.  
  455. EXTERN_API_C( OSErr )
  456. QTSPresSetNotificationProc        (QTSPresentation         inPresentation,
  457.                                  QTSNotificationUPP     inNotificationProc,
  458.                                  void *                    inRefCon);
  459.  
  460. EXTERN_API_C( OSErr )
  461. QTSPresGetNotificationProc        (QTSPresentation         inPresentation,
  462.                                  QTSNotificationUPP *    outNotificationProc,
  463.                                  void **                outRefCon);
  464.  
  465. /*-----------------------------------------
  466.     Presentation Control
  467. -----------------------------------------*/
  468. EXTERN_API_C( OSErr )
  469. QTSPresPreroll                    (QTSPresentation         inPresentation,
  470.                                  QTSStream                 inStream,
  471.                                  UInt32                 inTimeValue,
  472.                                  Fixed                     inRate,
  473.                                  SInt32                 inFlags);
  474.  
  475. EXTERN_API_C( OSErr )
  476. QTSPresPreroll64                (QTSPresentation         inPresentation,
  477.                                  QTSStream                 inStream,
  478.                                  const TimeValue64 *    inPrerollTime,
  479.                                  Fixed                     inRate,
  480.                                  SInt32                 inFlags);
  481.  
  482. EXTERN_API_C( OSErr )
  483. QTSPresStart                    (QTSPresentation         inPresentation,
  484.                                  QTSStream                 inStream,
  485.                                  SInt32                 inFlags);
  486.  
  487. EXTERN_API_C( OSErr )
  488. QTSPresSkipTo                    (QTSPresentation         inPresentation,
  489.                                  UInt32                 inTimeValue);
  490.  
  491. EXTERN_API_C( OSErr )
  492. QTSPresSkipTo64                    (QTSPresentation         inPresentation,
  493.                                  const TimeValue64 *    inTimeValue);
  494.  
  495. EXTERN_API_C( OSErr )
  496. QTSPresStop                        (QTSPresentation         inPresentation,
  497.                                  QTSStream                 inStream,
  498.                                  SInt32                 inFlags);
  499.  
  500. /*============================================================================
  501.         Streams
  502. ============================================================================*/
  503. /*-----------------------------------------
  504.     Stream Functions
  505. -----------------------------------------*/
  506. EXTERN_API_C( OSErr )
  507. QTSPresNewStream                (QTSPresentation         inPresentation,
  508.                                  OSType                 inDataType,
  509.                                  const void *            inData,
  510.                                  UInt32                 inDataLength,
  511.                                  SInt32                 inFlags,
  512.                                  QTSStream *            outStream);
  513.  
  514. EXTERN_API_C( OSErr )
  515. QTSDisposeStream                (QTSStream                 inStream,
  516.                                  SInt32                 inFlags);
  517.  
  518. EXTERN_API_C( UInt32 )
  519. QTSPresGetNumStreams            (QTSPresentation         inPresentation);
  520.  
  521. EXTERN_API_C( QTSStream )
  522. QTSPresGetIndStream                (QTSPresentation         inPresentation,
  523.                                  UInt32                 inIndex);
  524.  
  525. EXTERN_API_C( QTSPresentation )
  526. QTSGetStreamPresentation        (QTSStream                 inStream);
  527.  
  528. EXTERN_API_C( OSErr )
  529. QTSPresSetPreferredRate            (QTSPresentation         inPresentation,
  530.                                  Fixed                     inRate,
  531.                                  SInt32                 inFlags);
  532.  
  533. EXTERN_API_C( OSErr )
  534. QTSPresGetPreferredRate            (QTSPresentation         inPresentation,
  535.                                  Fixed *                outRate);
  536.  
  537. EXTERN_API_C( OSErr )
  538. QTSPresSetEnable                (QTSPresentation         inPresentation,
  539.                                  QTSStream                 inStream,
  540.                                  Boolean                 inEnableMode);
  541.  
  542. EXTERN_API_C( OSErr )
  543. QTSPresGetEnable                (QTSPresentation         inPresentation,
  544.                                  QTSStream                 inStream,
  545.                                  Boolean *                outEnableMode);
  546.  
  547. EXTERN_API_C( OSErr )
  548. QTSPresSetPresenting            (QTSPresentation         inPresentation,
  549.                                  QTSStream                 inStream,
  550.                                  Boolean                 inPresentingMode);
  551.  
  552. EXTERN_API_C( OSErr )
  553. QTSPresGetPresenting            (QTSPresentation         inPresentation,
  554.                                  QTSStream                 inStream,
  555.                                  Boolean *                outPresentingMode);
  556.  
  557. EXTERN_API_C( OSErr )
  558. QTSPresSetActiveSegment            (QTSPresentation         inPresentation,
  559.                                  QTSStream                 inStream,
  560.                                  const TimeValue64 *    inStartTime,
  561.                                  const TimeValue64 *    inDuration);
  562.  
  563. EXTERN_API_C( OSErr )
  564. QTSPresGetActiveSegment            (QTSPresentation         inPresentation,
  565.                                  QTSStream                 inStream,
  566.                                  TimeValue64 *            outStartTime,
  567.                                  TimeValue64 *            outDuration);
  568.  
  569. EXTERN_API_C( OSErr )
  570. QTSPresSetPlayHints                (QTSPresentation         inPresentation,
  571.                                  QTSStream                 inStream,
  572.                                  SInt32                 inFlags,
  573.                                  SInt32                 inFlagsMask);
  574.  
  575. EXTERN_API_C( OSErr )
  576. QTSPresGetPlayHints                (QTSPresentation         inPresentation,
  577.                                  QTSStream                 inStream,
  578.                                  SInt32 *                outFlags);
  579.  
  580. /*-----------------------------------------
  581.     Stream Spatial Functions
  582. -----------------------------------------*/
  583. EXTERN_API_C( OSErr )
  584. QTSPresSetGWorld                (QTSPresentation         inPresentation,
  585.                                  QTSStream                 inStream,
  586.                                  CGrafPtr                 inGWorld,
  587.                                  GDHandle                 inGDHandle);
  588.  
  589. EXTERN_API_C( OSErr )
  590. QTSPresGetGWorld                (QTSPresentation         inPresentation,
  591.                                  QTSStream                 inStream,
  592.                                  CGrafPtr *                outGWorld,
  593.                                  GDHandle *                outGDHandle);
  594.  
  595. EXTERN_API_C( OSErr )
  596. QTSPresSetClip                    (QTSPresentation         inPresentation,
  597.                                  QTSStream                 inStream,
  598.                                  RgnHandle                 inClip);
  599.  
  600. EXTERN_API_C( OSErr )
  601. QTSPresGetClip                    (QTSPresentation         inPresentation,
  602.                                  QTSStream                 inStream,
  603.                                  RgnHandle *            outClip);
  604.  
  605. EXTERN_API_C( OSErr )
  606. QTSPresSetMatrix                (QTSPresentation         inPresentation,
  607.                                  QTSStream                 inStream,
  608.                                  const MatrixRecord *    inMatrix);
  609.  
  610. EXTERN_API_C( OSErr )
  611. QTSPresGetMatrix                (QTSPresentation         inPresentation,
  612.                                  QTSStream                 inStream,
  613.                                  MatrixRecord *            outMatrix);
  614.  
  615. EXTERN_API_C( OSErr )
  616. QTSPresSetDimensions            (QTSPresentation         inPresentation,
  617.                                  QTSStream                 inStream,
  618.                                  Fixed                     inWidth,
  619.                                  Fixed                     inHeight);
  620.  
  621. EXTERN_API_C( OSErr )
  622. QTSPresGetDimensions            (QTSPresentation         inPresentation,
  623.                                  QTSStream                 inStream,
  624.                                  Fixed *                outWidth,
  625.                                  Fixed *                outHeight);
  626.  
  627. EXTERN_API_C( OSErr )
  628. QTSPresSetGraphicsMode            (QTSPresentation         inPresentation,
  629.                                  QTSStream                 inStream,
  630.                                  short                     inMode,
  631.                                  const RGBColor *        inOpColor);
  632.  
  633. EXTERN_API_C( OSErr )
  634. QTSPresGetGraphicsMode            (QTSPresentation         inPresentation,
  635.                                  QTSStream                 inStream,
  636.                                  short *                outMode,
  637.                                  RGBColor *                outOpColor);
  638.  
  639. EXTERN_API_C( OSErr )
  640. QTSPresGetPicture                (QTSPresentation         inPresentation,
  641.                                  QTSStream                 inStream,
  642.                                  PicHandle *            outPicture);
  643.  
  644. /*-----------------------------------------
  645.     Stream Sound Functions
  646. -----------------------------------------*/
  647. EXTERN_API_C( OSErr )
  648. QTSPresSetVolumes                (QTSPresentation         inPresentation,
  649.                                  QTSStream                 inStream,
  650.                                  short                     inLeftVolume,
  651.                                  short                     inRightVolume);
  652.  
  653. EXTERN_API_C( OSErr )
  654. QTSPresGetVolumes                (QTSPresentation         inPresentation,
  655.                                  QTSStream                 inStream,
  656.                                  short *                outLeftVolume,
  657.                                  short *                outRightVolume);
  658.  
  659.  
  660. /*============================================================================
  661.         Misc
  662. ============================================================================*/
  663. /* flags for Get/SetNetworkAppName */
  664. enum {
  665.     kQTSNetworkAppNameIsFullNameFlag = 0x00000001
  666. };
  667.  
  668. EXTERN_API_C( OSErr )
  669. QTSSetNetworkAppName            (const char *            inAppName,
  670.                                  SInt32                 inFlags);
  671.  
  672. EXTERN_API_C( OSErr )
  673. QTSGetNetworkAppName            (SInt32                 inFlags,
  674.                                  char **                outCStringPtr);
  675.  
  676. /*-----------------------------------------
  677.     Statistics Utilities
  678. -----------------------------------------*/
  679.  
  680. struct QTSStatHelperRecord {
  681.     long                             data[1];
  682. };
  683. typedef struct QTSStatHelperRecord        QTSStatHelperRecord;
  684.  
  685. typedef QTSStatHelperRecord *            QTSStatHelper;
  686. enum {
  687.     kQTSInvalidStatHelper        = 0L
  688. };
  689.  
  690. /* flags for QTSStatHelperNextParams */
  691. enum {
  692.     kQTSStatHelperReturnPascalStringsFlag = 0x00000001
  693. };
  694.  
  695.  
  696. struct QTSStatHelperNextParams {
  697.     SInt32                             flags;
  698.     OSType                             returnedStatisticsType;
  699.     QTSStream                         returnedStream;
  700.     UInt32                             maxStatNameLength;
  701.     char *                            returnedStatName;            /* NULL if you don't want it*/
  702.     UInt32                             maxStatStringLength;
  703.     char *                            returnedStatString;            /* NULL if you don't want it*/
  704.     UInt32                             maxStatUnitLength;
  705.     char *                            returnedStatUnit;            /* NULL if you don't want it*/
  706. };
  707. typedef struct QTSStatHelperNextParams    QTSStatHelperNextParams;
  708.  
  709. struct QTSStatisticsParams {
  710.     OSType                             statisticsType;
  711.     QTAtomContainer                 container;
  712.     QTAtom                             parentAtom;
  713.     SInt32                             flags;
  714. };
  715. typedef struct QTSStatisticsParams        QTSStatisticsParams;
  716. /* general statistics types */
  717. enum {
  718.     kQTSAllStatisticsType        = FOUR_CHAR_CODE('all '),
  719.     kQTSShortStatisticsType        = FOUR_CHAR_CODE('shrt'),
  720.     kQTSSummaryStatisticsType    = FOUR_CHAR_CODE('summ')
  721. };
  722.  
  723. /* statistics flags */
  724. enum {
  725.     kQTSGetNameStatisticsFlag    = 0x00000001,
  726.     kQTSDontGetDataStatisticsFlag = 0x00000002,
  727.     kQTSUpdateAtomsStatisticsFlag = 0x00000004,
  728.     kQTSGetUnitsStatisticsFlag    = 0x00000008
  729. };
  730.  
  731. /* statistics atom types */
  732. enum {
  733.     kQTSStatisticsStreamAtomType = FOUR_CHAR_CODE('strm'),
  734.     kQTSStatisticsNameAtomType    = FOUR_CHAR_CODE('name'),        /* chars only, no length or terminator */
  735.     kQTSStatisticsDataFormatAtomType = FOUR_CHAR_CODE('frmt'),    /* OSType */
  736.     kQTSStatisticsDataAtomType    = FOUR_CHAR_CODE('data'),
  737.     kQTSStatisticsUnitsAtomType    = FOUR_CHAR_CODE('unit'),        /* OSType */
  738.     kQTSStatisticsUnitsNameAtomType = FOUR_CHAR_CODE('unin')    /* chars only, no length or terminator */
  739. };
  740.  
  741. /* statistics data formats */
  742. enum {
  743.     kQTSStatisticsSInt32DataFormat = FOUR_CHAR_CODE('si32'),
  744.     kQTSStatisticsUInt32DataFormat = FOUR_CHAR_CODE('ui32'),
  745.     kQTSStatisticsSInt16DataFormat = FOUR_CHAR_CODE('si16'),
  746.     kQTSStatisticsUInt16DataFormat = FOUR_CHAR_CODE('ui16'),
  747.     kQTSStatisticsFixedDataFormat = FOUR_CHAR_CODE('fixd'),
  748.     kQTSStatisticsStringDataFormat = FOUR_CHAR_CODE('strg'),
  749.     kQTSStatisticsOSTypeDataFormat = FOUR_CHAR_CODE('ostp')
  750. };
  751.  
  752. /* statistics units types */
  753. enum {
  754.     kQTSStatisticsNoUnitsType    = 0,
  755.     kQTSStatisticsPercentUnitsType = FOUR_CHAR_CODE('pcnt'),
  756.     kQTSStatisticsBitsPerSecUnitsType = FOUR_CHAR_CODE('bps '),
  757.     kQTSStatisticsFramesPerSecUnitsType = FOUR_CHAR_CODE('fps ')
  758. };
  759.  
  760. /* specific statistics types */
  761. enum {
  762.     kQTSTotalDataRateStat        = FOUR_CHAR_CODE('drtt'),
  763.     kQTSTotalDataRateInStat        = FOUR_CHAR_CODE('drti'),
  764.     kQTSTotalDataRateOutStat    = FOUR_CHAR_CODE('drto'),
  765.     kQTSNetworkIDStringStat        = FOUR_CHAR_CODE('nids')
  766. };
  767.  
  768. EXTERN_API_C( OSErr )
  769. QTSNewStatHelper                (QTSPresentation         inPresentation,
  770.                                  QTSStream                 inStream,
  771.                                  OSType                 inStatType,
  772.                                  SInt32                 inFlags,
  773.                                  QTSStatHelper *        outStatHelper);
  774.  
  775. EXTERN_API_C( OSErr )
  776. QTSDisposeStatHelper            (QTSStatHelper             inStatHelper);
  777.  
  778. EXTERN_API_C( OSErr )
  779. QTSStatHelperGetStats            (QTSStatHelper             inStatHelper);
  780.  
  781. EXTERN_API_C( OSErr )
  782. QTSStatHelperResetIter            (QTSStatHelper             inStatHelper);
  783.  
  784. EXTERN_API_C( Boolean )
  785. QTSStatHelperNext                (QTSStatHelper             inStatHelper,
  786.                                  QTSStatHelperNextParams * ioParams);
  787.  
  788. EXTERN_API_C( UInt32 )
  789. QTSStatHelperGetNumStats        (QTSStatHelper             inStatHelper);
  790.  
  791. /* used by components to put statistics into the atom container */
  792. EXTERN_API_C( OSErr )
  793. QTSGetOrMakeStatAtomForStream    (QTAtomContainer         inContainer,
  794.                                  QTSStream                 inStream,
  795.                                  QTAtom *                outParentAtom);
  796.  
  797. EXTERN_API_C( OSErr )
  798. QTSInsertStatistic                (QTAtomContainer         inContainer,
  799.                                  QTAtom                 inParentAtom,
  800.                                  OSType                 inStatType,
  801.                                  void *                    inStatData,
  802.                                  UInt32                 inStatDataLength,
  803.                                  OSType                 inStatDataFormat,
  804.                                  SInt32                 inFlags);
  805.  
  806. EXTERN_API_C( OSErr )
  807. QTSInsertStatisticName            (QTAtomContainer         inContainer,
  808.                                  QTAtom                 inParentAtom,
  809.                                  OSType                 inStatType,
  810.                                  const char *            inStatName,
  811.                                  UInt32                 inStatNameLength);
  812.  
  813. EXTERN_API_C( OSErr )
  814. QTSInsertStatisticUnits            (QTAtomContainer         inContainer,
  815.                                  QTAtom                 inParentAtom,
  816.                                  OSType                 inStatType,
  817.                                  OSType                 inUnitsType,
  818.                                  const char *            inUnitsName,
  819.                                  UInt32                 inUnitsNameLength);
  820.  
  821. /*============================================================================
  822.         Data Formats
  823. ============================================================================*/
  824. /*-----------------------------------------
  825.     Data Types
  826. -----------------------------------------*/
  827. /* universal data types */
  828. enum {
  829.     kQTSNullDataType            = FOUR_CHAR_CODE('NULL'),
  830.     kQTSUnknownDataType            = FOUR_CHAR_CODE('huh?'),
  831.     kQTSAtomContainerDataType    = FOUR_CHAR_CODE('qtac'),        /* QTAtomContainer */
  832.     kQTSAtomDataType            = FOUR_CHAR_CODE('qtat'),        /* QTSAtomContainerDataStruct* */
  833.     kQTSAliasDataType            = FOUR_CHAR_CODE('alis'),
  834.     kQTSFileDataType            = FOUR_CHAR_CODE('fspc')
  835. };
  836.  
  837. /* these data types are specific to presentations */
  838. enum {
  839.     kQTSRTSPDataType            = FOUR_CHAR_CODE('rtsp'),
  840.     kQTSSDPDataType                = FOUR_CHAR_CODE('sdp ')
  841. };
  842.  
  843. /*-----------------------------------------
  844.     Atom IDs
  845. -----------------------------------------*/
  846. enum {
  847.     kQTSPresentationAID            = FOUR_CHAR_CODE('pres'),
  848.     kQTSPresentationHeaderAID    = FOUR_CHAR_CODE('phdr'),        /* QTSPresentationHeaderAtom */
  849.     kQTSMediaStreamAID            = FOUR_CHAR_CODE('mstr'),
  850.     kQTSMediaStreamHeaderAID    = FOUR_CHAR_CODE('mshd'),        /* QTSMediaStreamHeaderAtom */
  851.     kQTSMediaDescriptionTextAID    = FOUR_CHAR_CODE('mdes'),        /* text, no length */
  852.     kQTSClipRectAID                = FOUR_CHAR_CODE('clip'),        /* QTSClipRectAtom */
  853.     kQTSDurationAID                = FOUR_CHAR_CODE('dura'),        /* QTSDurationAtom */
  854.     kQTSBufferTimeAID            = FOUR_CHAR_CODE('bufr')        /* QTSBufferTimeAtom */
  855. };
  856.  
  857.  
  858. struct QTSAtomContainerDataStruct {
  859.     QTAtomContainer                 container;
  860.     QTAtom                             parentAtom;
  861. };
  862. typedef struct QTSAtomContainerDataStruct QTSAtomContainerDataStruct;
  863. /* flags for QTSPresentationHeaderAtom */
  864. enum {
  865.     kQTSPresHeaderTypeIsData    = 0x00000100,
  866.     kQTSPresHeaderDataIsHandle    = 0x00000200
  867. };
  868.  
  869.  
  870. struct QTSPresentationHeaderAtom {
  871.     SInt32                             versionAndFlags;
  872.     OSType                             conductorOrDataType;
  873.     OSType                             dataAtomType;                /* where the data really is*/
  874. };
  875. typedef struct QTSPresentationHeaderAtom QTSPresentationHeaderAtom;
  876.  
  877. struct QTSMediaStreamHeaderAtom {
  878.     SInt32                             versionAndFlags;
  879.     OSType                             mediaTransportType;
  880.     OSType                             mediaTransportDataAID;        /* where the data really is*/
  881. };
  882. typedef struct QTSMediaStreamHeaderAtom    QTSMediaStreamHeaderAtom;
  883.  
  884. struct QTSBufferTimeAtom {
  885.     SInt32                             versionAndFlags;
  886.     Fixed                             bufferTime;
  887. };
  888. typedef struct QTSBufferTimeAtom        QTSBufferTimeAtom;
  889.  
  890. struct QTSDurationAtom {
  891.     SInt32                             versionAndFlags;
  892.     TimeScale                         timeScale;
  893.     TimeValue64                     duration;
  894. };
  895. typedef struct QTSDurationAtom            QTSDurationAtom;
  896.  
  897. struct QTSClipRectAtom {
  898.     SInt32                             versionAndFlags;
  899.     Rect                             clipRect;
  900. };
  901. typedef struct QTSClipRectAtom            QTSClipRectAtom;
  902. enum {
  903.     kQTSEmptyEditStreamStartTime = -1
  904. };
  905.  
  906.  
  907.  
  908. typedef UInt32                             QTSStatus;
  909. enum {
  910.     kQTSNullStatus                = 0,
  911.     kQTSUninitializedStatus        = 1,
  912.     kQTSConnectingStatus        = 2,
  913.     kQTSOpeningConnectionDetailedStatus = 3,
  914.     kQTSMadeConnectionDetailedStatus = 4,
  915.     kQTSNegotiatingStatus        = 5,
  916.     kQTSGettingDescriptionDetailedStatus = 6,
  917.     kQTSGotDescriptionDetailedStatus = 7,
  918.     kQTSSentSetupCmdDetailedStatus = 8,
  919.     kQTSReceivedSetupResponseDetailedStatus = 9,
  920.     kQTSSentPlayCmdDetailedStatus = 10,
  921.     kQTSReceivedPlayResponseDetailedStatus = 11,
  922.     kQTSBufferingStatus            = 12,
  923.     kQTSPlayingStatus            = 13,
  924.     kQTSPausedStatus            = 14,
  925.     kQTSAutoConfiguringStatus    = 15,
  926.     kQTSDownloadingStatus        = 16,
  927.     kQTSWaitingDisconnectStatus    = 100
  928. };
  929.  
  930. /*-----------------------------------------
  931.     QuickTime Preferences Types
  932. -----------------------------------------*/
  933. enum {
  934.     kQTSConnectionPrefsType        = FOUR_CHAR_CODE('stcm'),        /* root atom that all other atoms are contained in*/
  935.                                                                 /*    kQTSNotUsedForProxyPrefsType =    'nopr',        //         comma-delimited list of URLs that are never used for proxies*/
  936.     kQTSConnectionMethodPrefsType = FOUR_CHAR_CODE('mthd'),        /*         connection method (OSType that matches one of the following three)*/
  937.     kQTSDirectConnectPrefsType    = FOUR_CHAR_CODE('drct'),        /*        used if direct connect (QTSDirectConnectPrefsRecord)*/
  938.                                                                 /*    kQTSRTSPProxyPrefsType =        'rtsp',        //        used if RTSP Proxy (QTSProxyPrefsRecord)*/
  939.     kQTSSOCKSPrefsType            = FOUR_CHAR_CODE('sock')        /*        used if SOCKS Proxy (QTSProxyPrefsRecord)*/
  940. };
  941.  
  942. enum {
  943.     kQTSDirectConnectHTTPProtocol = FOUR_CHAR_CODE('http'),
  944.     kQTSDirectConnectRTSPProtocol = FOUR_CHAR_CODE('rtsp')
  945. };
  946.  
  947.  
  948. struct QTSDirectConnectPrefsRecord {
  949.     UInt32                             tcpPortID;
  950.     OSType                             protocol;
  951. };
  952. typedef struct QTSDirectConnectPrefsRecord QTSDirectConnectPrefsRecord;
  953.  
  954. struct QTSProxyPrefsRecord {
  955.     Str255                             serverNameStr;
  956.     UInt32                             portID;
  957. };
  958. typedef struct QTSProxyPrefsRecord        QTSProxyPrefsRecord;
  959. #define    kQTSTransAndProxyPrefsVersNum        2        // prefs atom format version
  960. enum {
  961.     kConnectionActive            = (1L << 0),
  962.     kConnectionUseSystemPref    = (1L << 1)
  963. };
  964.  
  965.  
  966. struct QTSTransportPref {
  967.     OSType                             protocol;                    /* udp, http, tcp, etc*/
  968.     SInt32                             portID;                        /* port to use for this connection type*/
  969.     UInt32                             flags;                        /* connection flags*/
  970.     UInt32                             seed;                        /* seed value last time this setting was read from system prefs*/
  971. };
  972. typedef struct QTSTransportPref            QTSTransportPref;
  973. enum {
  974.     kProxyActive                = (1L << 0),
  975.     kProxyUseSystemPref            = (1L << 1)
  976. };
  977.  
  978.  
  979. struct QTSProxyPref {
  980.     UInt32                             flags;                        /* proxy flags*/
  981.     SInt32                             portID;                        /* port to use for this connection type*/
  982.     UInt32                             seed;                        /* seed value last time this setting was read from system prefs*/
  983.     Str255                             serverNameStr;                /* proxy server url*/
  984. };
  985. typedef struct QTSProxyPref                QTSProxyPref;
  986. enum {
  987.     kNoProxyUseSystemPref        = (1L << 0)
  988. };
  989.  
  990.  
  991. struct QTSNoProxyPref {
  992.     UInt32                             flags;                        /* no-proxy flags*/
  993.     UInt32                             seed;                        /* seed value last time this setting was read from system prefs*/
  994.     char                             urlList[1];                    /* NULL terminated, comma delimited list of urls*/
  995. };
  996. typedef struct QTSNoProxyPref            QTSNoProxyPref;
  997. enum {
  998.     kQTSTransAndProxyAtomType    = FOUR_CHAR_CODE('strp'),        /* transport/proxy prefs root atom*/
  999.     kQTSConnectionPrefsVersion    = FOUR_CHAR_CODE('vers'),        /*   prefs format version*/
  1000.     kQTSTransportPrefsAtomType    = FOUR_CHAR_CODE('trns'),        /*   tranport prefs root atom*/
  1001.     kQTSConnectionAtomType        = FOUR_CHAR_CODE('conn'),        /*     connection prefs atom type, one for each transport type*/
  1002.     kQTSUDPTransportType        = FOUR_CHAR_CODE('udp '),        /*     udp transport prefs*/
  1003.     kQTSHTTPTransportType        = FOUR_CHAR_CODE('http'),        /*     http transport prefs*/
  1004.     kQTSTCPTransportType        = FOUR_CHAR_CODE('tcp '),        /*     tcp transport prefs    */
  1005.     kQTSProxyPrefsAtomType        = FOUR_CHAR_CODE('prxy'),        /*   proxy prefs root atom*/
  1006.     kQTSHTTPProxyPrefsType        = FOUR_CHAR_CODE('http'),        /*     http proxy settings*/
  1007.     kQTSRTSPProxyPrefsType        = FOUR_CHAR_CODE('rtsp'),        /*     rtsp proxy settings*/
  1008.     kQTSSOCKSProxyPrefsType        = FOUR_CHAR_CODE('scks'),        /*     socks proxy settings*/
  1009.     kQTSDontProxyPrefsAtomType    = FOUR_CHAR_CODE('nopr'),        /*   no-proxy prefs root atom*/
  1010.     kQTSDontProxyDataType        = FOUR_CHAR_CODE('data')        /*     no proxy settings*/
  1011. };
  1012.  
  1013. EXTERN_API_C( OSErr )
  1014. QTSPrefsAddProxySetting            (OSType                 proxyType,
  1015.                                  SInt32                 portID,
  1016.                                  UInt32                 flags,
  1017.                                  UInt32                 seed,
  1018.                                  Str255                 srvrURL);
  1019.  
  1020. EXTERN_API_C( OSErr )
  1021. QTSPrefsFindProxyByType            (OSType                 proxyType,
  1022.                                  UInt32                 flags,
  1023.                                  UInt32                 flagsMask,
  1024.                                  QTSProxyPref **        proxyHndl,
  1025.                                  SInt16 *                count);
  1026.  
  1027. EXTERN_API_C( OSErr )
  1028. QTSPrefsAddConnectionSetting    (OSType                 protocol,
  1029.                                  SInt32                 portID,
  1030.                                  UInt32                 flags,
  1031.                                  UInt32                 seed);
  1032.  
  1033. EXTERN_API_C( OSErr )
  1034. QTSPrefsFindConnectionByType    (OSType                 protocol,
  1035.                                  UInt32                 flags,
  1036.                                  UInt32                 flagsMask,
  1037.                                  QTSTransportPref **    connectionHndl,
  1038.                                  SInt16 *                count);
  1039.  
  1040. EXTERN_API_C( OSErr )
  1041. QTSPrefsGetActiveConnection        (OSType                 protocol,
  1042.                                  QTSTransportPref *        connectInfo);
  1043.  
  1044. EXTERN_API_C( OSErr )
  1045. QTSPrefsGetNoProxyURLs            (QTSNoProxyPref **        noProxyHndl);
  1046.  
  1047. EXTERN_API_C( OSErr )
  1048. QTSPrefsSetNoProxyURLs            (char *                    urls,
  1049.                                  UInt32                 flags,
  1050.                                  UInt32                 seed);
  1051.  
  1052.  
  1053.  
  1054. /*============================================================================
  1055.         Memory Management Services
  1056. ============================================================================*/
  1057. /*
  1058.    These routines allocate normal pointers and handles,
  1059.    but do the correct checking, etc.
  1060.    Dispose using the normal DisposePtr and DisposeHandle
  1061.    Call these routines for one time memory allocations.
  1062.    You do not need to set any hints to use these calls.
  1063. */
  1064.  
  1065. EXTERN_API_C( Ptr )
  1066. QTSNewPtr                        (UInt32                 inByteCount,
  1067.                                  SInt32                 inFlags,
  1068.                                  SInt32 *                outFlags);
  1069.  
  1070. EXTERN_API_C( Handle )
  1071. QTSNewHandle                    (UInt32                 inByteCount,
  1072.                                  SInt32                 inFlags,
  1073.                                  SInt32 *                outFlags);
  1074.  
  1075. #define QTSNewPtrClear(_s)        QTSNewPtr((_s), kQTSMemAllocClearMem, NULL)
  1076. #define QTSNewHandleClear(_s)    QTSNewHandle((_s), kQTSMemAllocClearMem, NULL)
  1077. /* flags in*/
  1078. enum {
  1079.     kQTSMemAllocClearMem        = 0x00000001,
  1080.     kQTSMemAllocDontUseTempMem    = 0x00000002,
  1081.     kQTSMemAllocTryTempMemFirst    = 0x00000004,
  1082.     kQTSMemAllocDontUseSystemMem = 0x00000008,
  1083.     kQTSMemAllocTrySystemMemFirst = 0x00000010,
  1084.     kQTSMemAllocHoldMemory        = 0x00001000,
  1085.     kQTSMemAllocIsInterruptTime    = 0x01010000                    /* currently not supported for alloc*/
  1086. };
  1087.  
  1088. /* flags out*/
  1089. enum {
  1090.     kQTSMemAllocAllocatedInTempMem = 0x00000001,
  1091.     kQTSMemAllocAllocatedInSystemMem = 0x00000002
  1092. };
  1093.  
  1094. typedef struct OpaqueQTSMemPtr*         QTSMemPtr;
  1095. /*
  1096.    These routines are for buffers that will be recirculated
  1097.    you must use QTReleaseMemPtr instead of DisposePtr
  1098.    QTSReleaseMemPtr can be used at interrupt time
  1099.    but QTSAllocMemPtr currently cannot 
  1100. */
  1101. EXTERN_API_C( QTSMemPtr )
  1102. QTSAllocMemPtr                    (UInt32                 inByteCount,
  1103.                                  SInt32                 inFlags);
  1104.  
  1105. EXTERN_API_C( void )
  1106. QTSReleaseMemPtr                (QTSMemPtr                 inMemPtr,
  1107.                                  SInt32                 inFlags);
  1108.  
  1109.  
  1110. /*============================================================================
  1111.         Buffer Management Services
  1112. ============================================================================*/
  1113.  
  1114. struct QTSStreamBuffer {
  1115.     struct QTSStreamBuffer *        reserved1;
  1116.     struct QTSStreamBuffer *        reserved2;
  1117.     struct QTSStreamBuffer *        next;                        /* next message block in a message */
  1118.     unsigned char *                    rptr;                        /* first byte with real data in the DataBuffer */
  1119.     unsigned char *                    wptr;                        /* last+1 byte with real data in the DataBuffer */
  1120.     long                             reserved3;
  1121.     UInt32                             metadata[4];                /* usage defined by message sender */
  1122.     SInt32                             flags;                        /* reserved */
  1123. };
  1124. typedef struct QTSStreamBuffer            QTSStreamBuffer;
  1125. EXTERN_API_C( QTSStreamBuffer *)
  1126. QTSAllocBuffer                    (SInt32                 size);
  1127.  
  1128. EXTERN_API_C( void )
  1129. QTSFreeMessage                    (QTSStreamBuffer *        inStreamBuffer);
  1130.  
  1131. EXTERN_API_C( QTSStreamBuffer *)
  1132. QTSDupMessage                    (QTSStreamBuffer *        inStreamBuffer);
  1133.  
  1134. EXTERN_API_C( QTSStreamBuffer *)
  1135. QTSCopyMessage                    (QTSStreamBuffer *        inStreamBuffer);
  1136.  
  1137. EXTERN_API_C( QTSStreamBuffer *)
  1138. QTSFlattenMessage                (QTSStreamBuffer *        inStreamBuffer);
  1139.  
  1140. EXTERN_API_C( SInt32 )
  1141. QTSMessageLength                (QTSStreamBuffer *        inStreamBuffer);
  1142.  
  1143.  
  1144. /*============================================================================
  1145.         Misc
  1146. ============================================================================*/
  1147. EXTERN_API_C( Boolean )
  1148. QTSGetErrorString                (SInt32                 inErrorCode,
  1149.                                  UInt32                 inMaxErrorStringLength,
  1150.                                  char *                    outErrorString,
  1151.                                  SInt32                 inFlags);
  1152.  
  1153.  
  1154.  
  1155. /* UPP call backs */
  1156. #if OPAQUE_UPP_TYPES
  1157.     EXTERN_API(QTSNotificationUPP)
  1158.     NewQTSNotificationUPP           (QTSNotificationProcPtr    userRoutine);
  1159.  
  1160.     EXTERN_API(void)
  1161.     DisposeQTSNotificationUPP       (QTSNotificationUPP        userUPP);
  1162.  
  1163.     EXTERN_API(ComponentResult)
  1164.     InvokeQTSNotificationUPP       (ComponentResult            inErr,
  1165.                                     OSType                    inNotificationType,
  1166.                                     void *                    inNotificationParams,
  1167.                                     void *                    inRefCon,
  1168.                                     QTSNotificationUPP        userUPP);
  1169.  
  1170. #else
  1171.     enum { uppQTSNotificationProcInfo = 0x00003FF0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  1172.     #define NewQTSNotificationUPP(userRoutine)                         (QTSNotificationUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppQTSNotificationProcInfo, GetCurrentArchitecture())
  1173.     #define DisposeQTSNotificationUPP(userUPP)                         DisposeRoutineDescriptor(userUPP)
  1174.     #define InvokeQTSNotificationUPP(inErr, inNotificationType, inNotificationParams, inRefCon, userUPP)  (ComponentResult)CALL_FOUR_PARAMETER_UPP((userUPP), uppQTSNotificationProcInfo, (inErr), (inNotificationType), (inNotificationParams), (inRefCon))
  1175. #endif
  1176. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  1177. #define NewQTSNotificationProc(userRoutine)                     NewQTSNotificationUPP(userRoutine)
  1178. #define CallQTSNotificationProc(userRoutine, inErr, inNotificationType, inNotificationParams, inRefCon) InvokeQTSNotificationUPP(inErr, inNotificationType, inNotificationParams, inRefCon, userRoutine)
  1179.  
  1180. #if PRAGMA_STRUCT_ALIGN
  1181.     #pragma options align=reset
  1182. #elif PRAGMA_STRUCT_PACKPUSH
  1183.     #pragma pack(pop)
  1184. #elif PRAGMA_STRUCT_PACK
  1185.     #pragma pack()
  1186. #endif
  1187.  
  1188. #ifdef PRAGMA_IMPORT_OFF
  1189. #pragma import off
  1190. #elif PRAGMA_IMPORT
  1191. #pragma import reset
  1192. #endif
  1193.  
  1194. #ifdef __cplusplus
  1195. }
  1196. #endif
  1197.  
  1198. #endif /* __QUICKTIMESTREAMING__ */
  1199.  
  1200.